#!/bin/bash
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2021. All rights reserved.
# Description: run.sh.
# Author: MindX SDK
# Create: 2021
# History: NA

set -e
CUR_PATH=$(cd "$(dirname "$0")" || { warn "Failed to check path/to/run.sh" ; exit ; } ; pwd)  # run.sh为脚本名称

if [ ! -O "$0" ]; then
    echo "Error: run.sh is not belong to the current user."
    exit 1
fi

if [ $(id -u) -eq 0 ]; then
    echo "Warning: This shell is executed by root."
fi

# Simple log helper functions
info() { echo -e "\033[1;34m[INFO ][MxBase] $1\033[1;37m" ; }
warn() { echo >&2 -e "\033[1;31m[WARN ][MxBase] $1\033[1;37m" ; }
. /usr/local/Ascend/ascend-toolkit/set_env.sh
#. ../../../set_env.sh
# complie
cmake -S . -Bbuild
make -C ./build  -j
# run
#./main  # main为main.cpp编译后的可执行文件
exit 0
